import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    cart: {
      count: 0,
    },
    user: {
      token: sessionStorage.token || localStorage.token,
      username: sessionStorage.username || localStorage.username,
      id: sessionStorage.id || localStorage.id,
    }
  },
  mutations: {
    // addcart(state, data) {
    //   state.cart.count = data.count;
    // }
  }
});


